import React, { Component } from 'react';
import {
    StyleSheet,
} from 'react-native';
import {
    StackNavigator,
    TabNavigator
} from 'react-navigation';
import HomeComponent from '../myComponent/HomeComponent';
import NewsComponent from './NewsComponent';
import CollectComponent from './CollectComponent';
import MineComponent from './MineComponent';
import ItemDetail from '../myComponent/ItemDetail';
// 通过TabNavigator做路由映射
const MainScreentNavigator=TabNavigator({
    HomeComponent:{screen:HomeComponent},
    NewsComponent:{screen:NewsComponent},
    CollectComponent:{screen:CollectComponent},
    MineComponent:{screen:MineComponent},
},{
    tabBarPosition: 'bottom',//设置导航栏位置 在底部
    swipeEnabled:false,//设置底部导航禁止滑动
    tabBarOptions:{
        // activeTintColor:"#bb6b50",//文字和图片选中颜色
        // inactiveTintColor:"#333",//文字和图片默认颜色
       showIcon:true,//android 默认不显示icon 需要设置成true
        indicatorStyle:{//android 默认tabbar下显示一条线，高度设为0，就不显示了
           height:0
        },
        // style:{
        //     backgroundColor:"red",//tabbar背景色
        //     height:50,
        // },
        labelStyle:{
            fontSize:12,//文字大小
            marginTop:-1
        },
        tabBarIconStyle:{
            marginTop:-3
        }

    }
});
//引入要用到的跳转页面
  const  MyNavigatior = StackNavigator({
    Main:{screen:MainScreentNavigator},
      ItemDetail:{screen:ItemDetail},
},{
    navigationOptions:{
        header: null,//隐藏系统自带的title
    }
  });

export default MyNavigatior;